
<h1><?php echo $title; ?></h1>
<div class="noprint">
<?php if (isset($notice) || $notice = $this->session->flashdata('notification')):?>
<p class="notice"><?php echo $notice;?></p>
<?php endif;?>

<?php if (count($rows) == 0) : ?>
<p class="notice"><?php echo __("Nessuno risultato", $module);?></p>
<?php endif; ?>

<form method='post' action='<?php echo site_url('adozioni/contabilita/missioni/tutti') ?>'>

<fieldset style=" margin: auto;">
<legend>Scelta</legend>
<label for="anno">
<input type="text" name="anno" value="<?php echo $anno ?>" />
</label>

<label for="mese" style="background-color: #EEEEEE;"> 
<select name="mese" id="mese">
<?php for($i = 1; $i <= 12; $i++): ?>
<option value="<?php echo $i; ?>" <?php if($i == $mese) echo "selected" ?>><?php echo $nome_mese[$i] ?></option>
<?php endfor; ?>
</select>
</label>
<?php /*
<br />
<label for="id_rimesse">Rimessa :
<select name="id_rimesse"><option></option>
<?php foreach($rimesse as $r): ?>
<option value="<?php echo $r['id'] ?>" <?php if(isset($id_rimesse) && $id_rimesse == $r['id']) echo "selected"; ?>><?php echo $r['nome'] ?></option>
<?php endforeach; ?>
</select></label>
*/ ?>
<label for="excel">Excel <input type="checkbox" name="excel" value="1" /></label> 
<input type="submit" name="go" value="  Visualizza  "/>

</fieldset>

</form>

</div>

	<table class='list'>
		<tr>
			<td width="5"></td><td></td>
            <?php foreach($conti as $c): ?>
			<th><?php echo $c['nome']; ?></th>
            <?php endforeach; ?>
			<th><?php echo __("Lordo", $module); ?></th>
			<th><?php echo __("Ritenuta", $module); ?></th>
			<th><?php echo __("Totale Netto", $module); ?></th>
		</tr>

<?php $k =1; foreach($rows as $categoria => $rimesse): ?>
		<tr><td style="background-color: lightgreen; border-bottom: 2px solid lightgreen; font-size: 15px; font-weight: bold;" colspan="8"><?php echo  $categoria ?></th></td>
		<?php foreach($rimesse as $rimessa => $missioni): ?>
		<tr><td style="background-color: lightblue; border-bottom: 2px solid lightblue; font-weight: bold;" colspan="8"><?php echo __("Rimessa: ", $module) . $rimessa?></th></td>
            <?php foreach($missioni as $missione => $val): ?>
            <tr>
                <td><?php echo $k; ?></td>
                <th width='37%' style='text-align:left;'><?php echo $missione; ?></th>
                 <?php foreach($conti as $c): ?>
                <td align='right' width='10%'><?php echo (isset($val[ $c['nome']]))? format_euro($val[ $c['nome']]): '0,00'; ?></td>
                <?php endforeach; ?>
                <td align='right' width='10%'><?php echo format_euro($val[ 'tot_lordo']) ?></td>
                <td align='right' width='10%'><?php echo format_euro($val[ 'tot_trattenuta']) ?></td>
                <td align='right' class='total' width='10%'><?php echo format_euro($val[ 'tot_netto']) ?></td>
            </tr>
            <?php $k++; endforeach; ?>
		<?php endforeach; ?>
<?php  endforeach; ?>
	<tr><th colspan='2' align="right"><?php echo __("Totale Generale", $module) ?></th>
	 <?php foreach($conti as $c): ?>
	<td align='right' class='total'><?php echo (isset($totale_conto[ $c['nome']]))? format_euro($totale_conto[ $c['nome']]): '0,00'; ?></td>
	<?php endforeach; ?>
	<td align="right" class="total"><?php echo format_euro($totale_lordo) ?></td>
	<td align="right" class="total"><?php echo format_euro($totale_trattenuta) ?></td>
	<td align="right" class="total"><?php echo format_euro($totale_generale) ?></td></tr>
    </table>

